package com.cskaoyan.shopping.controller;

import com.cskaoyan.mall.commons.result.ResponseData;
import com.cskaoyan.mall.commons.result.ResponseUtil;
import com.cskaoyan.shopping.dto.PanelContentDto;
import com.cskaoyan.shopping.dto.PanelDto;
import com.cskaoyan.shopping.service.IHomeService;
import com.cskaoyan.shopping.service.INavigationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.xml.crypto.Data;
import java.util.List;
import java.util.Set;

/***
 * title ZShoppingController
 * @description <TODO description class purpose>
 * @author ZCZ
 * @version 1.0.0
 * @create 2022/9/21 10:26
 **/
@RestController
public class ZShoppingController {

    @Autowired
    IHomeService iHomeService;

    @Autowired
    INavigationService iNavigationService;

    @GetMapping("/shopping/homepage")
    public ResponseData homepage(){
        List<PanelDto> homepage = iHomeService.homepages();
        return new ResponseUtil().setData(homepage);
    }
    @GetMapping("/shopping/navigation")
    public ResponseData navigation(){
        List<PanelContentDto> navigation = iNavigationService.navigation();
        return new ResponseUtil().setData(navigation);
    }

    @GetMapping("/shopping/seckilllist")
    public ResponseData seckilllist(int sessionId){
        return new ResponseUtil().setErrorMsg("秒杀活动不存在");
    }
}
